package com.paic.mhis.hcpms.agreement.healthcareprovider.util;

import java.util.Collections;
import java.util.List;

import com.paic.mhis.hcpms.agreement.healthcareprovider.dto.StandardScoreDTO;

/**
 * 对StandardScoreDTO对象第一二层排序
 * 
 * @author GUOSHUNXU092
 * @time 2014-12-10
 */
public class SortTools {

	String parten = "^\\d+$";

	/**
	 * 
	 * @param dbResultList
	 */
	public static void sortListToNomalOrder(StandardScoreDTO inputDto) {

		StandardScoreDTOComparator comparator = new StandardScoreDTOComparator();

		List<StandardScoreDTO> dbResultList = inputDto.getDtoList();
		if (dbResultList == null) {
			return;// 如果传入对象不存在，则无序排序。
		}

		for (StandardScoreDTO scoreDTOs : dbResultList) {
			// 对第二层排序
			List<StandardScoreDTO> seconDtos = scoreDTOs.getDtoList();
			if (seconDtos != null) {
				System.out.println("sort second");
				Collections.sort(seconDtos, comparator);
			}
		}
		// 对第一层排序
		Collections.sort(dbResultList, comparator);

	}

}
